C1.WPF.FlexGrid Namespace > RowColCollection<T> Class : DeferNotifications Method |
'Declaration Public Function DeferNotifications() As System.IDisposable
public System.IDisposable DeferNotifications()
The example below shows how you can use the DeferNotifications method to suspend notifications while setting the width of several columns on the grid.
Note that the call to the DeferNotifications method is placed in a using statement, which automatically disposes of the object and restores notifications at the end of the block, even if the code within the block throws an exception. This makes the code more readable and concise than calling the more traditional BeginUpdate and EndUpdate methods within a try/finally block.
var grid = new C1FlexGrid(); using (grid.Columns.DeferNotifications()) { foreach (var col in grid.Columns) { col.Width = 100; } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2